package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.HashMap;

@Setter
@Getter
public class Notice {
    private Long id;
    //发布人
    private Employee issuer;
    //发布时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    private Date pubdate;
    //标题
    private String title;

    //是否已读
    private String read;
    //公告
    private String content;

    public String getJson(){
        HashMap map = new HashMap();
        map.put("id",id);
        map.put("issuer",issuer);
        map.put("title",title);
        map.put("read",read);
        map.put("content",content);

        return JSON.toJSONString(map);
    }
}